package com.webbei.util;

import java.util.Random;

/**
 * 字符串处理工具类
 * @author xingxing
 *
 */
public class StringUtil {
	
	public static String getRandomString(int length){
		String base = "0123456789abcdefghijklmnopqrstuvwxyz"
			         +"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		int l = base.length();
		Random r = new Random();
		StringBuffer sb = new StringBuffer();
		for(int i=0;i<length;i++){
			sb.append(base.charAt(r.nextInt(l)));
		}
		return sb.toString();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println(getRandomString(30));

	}

}
